package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.ManBean;
import com.project.bean.RoomBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface IManMapper extends BaseMapper<ManBean> {
    void addRoomList(@Param("manId") int manId, @Param("roomList") List<RoomBean> roomList);

    @Delete("update t_room set fk_manId=null where fk_manId=#{id};" +
            "delete from t_man where pk_manId=#{id};")
    void del(int id);
}
